/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved.
 */
package com.icinfo.cloud.provider.punish.ucase.casemain.controller;

import com.icinfo.cloud.provider.punish.ucase.casemain.dto.CaseSurveyPeopleInfoDto;
import com.icinfo.cloud.provider.punish.ucase.casemain.dto.CaseSurveyPeopleInfoQueryDto;
import com.icinfo.cloud.provider.punish.ucase.casemain.service.ICaseSurveyPeopleInfoService;
import com.icinfo.framework.common.web.Result;
import com.icinfo.framework.core.web.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 描述:  case_survey_people_info 对应的Controller类.<br>
 *
 * @author framework generator
 * @date 2022年12月14日
 */
@RestController
@RefreshScope
@RequestMapping("/punish/ucase/case/survey")
@Slf4j
public class CaseSurveyPeopleInfoController extends BaseController {
    /**
     * 日志记录器
     */
    private static final Logger logger = LoggerFactory.getLogger(CaseSurveyPeopleInfoController.class);

    @Autowired
    private ICaseSurveyPeopleInfoService caseSurveyPeopleInfoService;

    /**
     * 新增被调查人
     * @param dto
     * @return
     */
    @PostMapping("/saveSurveyPeopleInfo")
    public Result saveSurveyPeopleInfo(@RequestBody CaseSurveyPeopleInfoDto dto){
        String id = caseSurveyPeopleInfoService.saveSurveyPeopleInfo(dto);
        return Result.success(id);
    }

    /**
     * 修改被调查人
     * @param dto
     * @return
     */
    @PostMapping("/updateSurveyPeopleInfo")
    public Result updateSurveyPeopleInfo(@RequestBody CaseSurveyPeopleInfoDto dto){
        caseSurveyPeopleInfoService.updateSurveyPeopleInfo(dto);
        return Result.success("修改成功");
    }


    /**
     * 获取被调查人详情
     * @param dto
     * @return
     */
    @PostMapping("/getSurveyPeopleInfo")
    public Result getSurveyPeopleInfo(@RequestBody CaseSurveyPeopleInfoDto dto){
        return Result.success(caseSurveyPeopleInfoService.getSurveyPeopleInfo(dto));
    }



    /**
     * 获取被调查人详情
     * @param dto
     * @return
     */
    @PostMapping("/getSurveyPeopleInfoByDocument")
    public Result getSurveyPeopleInfoByDocument(@RequestBody CaseSurveyPeopleInfoQueryDto dto){
        return Result.success(caseSurveyPeopleInfoService.getSurveyPeopleInfoByDocument(dto));
    }


}
